(function ($) {
    $.fn.bdhd = function (options) {
        var defaults = {
            box: "_player",//弹出播放窗口的ID名称
            width: "960", //播放器的宽度
            height: "530"//播发器的高度
        };

        options = $.extend(defaults, options);

        this.each(function () {
            var obj = $(this);
            var qvod_address = {
                content_id : obj.attr("content_id"),
                url_id : obj.attr("url_id")
            };
            var qvod_title = "";
            open_box(qvod_title, qvod_address);
        });

        function open_box(qvod_title, qvod_address) {
            var player_obj = $('#' + options.box);
            player_obj.css({
                width: Number(options.width),
                height: Number(options.height),
                display: "block"
            });
            var html = [];
            html.push(
                '<div class="title" style="width:50%; float:left; font-size:12px; margin-top:3px; padding-left:5px; cursor:move;">正在播放 ' + qvod_title + '</div>' +
                '<iframe src="/play/bd?1='+(qvod_address.content_id)+'&2='+(qvod_address.url_id)+'&t='+((new Date()).getTime())+'" scrolling="no" width="' + options.width + '" height="' + parseInt(options.height) + '" frameborder="0" marginheight="0" marginwidth="0"></iframe>'
            );
            player_obj.html(html.join(''));
        }
    };
})(jQuery);



